package com.yango.teach.client;

import com.yango.teach.client.impl.OrderClientImpl;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author Li.Ding.yin
 * @create 2021年08月04日23:35-星期三
 * @role 远程调用订单微服务
 */
@Component
@FeignClient(name = "server-order",fallback = OrderClientImpl.class)
public interface OrderClient {

    //根据课程id和用户id查询订单状态
    @ApiOperation(value = "根据课程id和用户id查询订单状态")
    @GetMapping("/orderService/order/isBuyCourse/{courseId}/{memberId}")
    public boolean isBuyCourse(@ApiParam(name = "courseId", value = "课程id", required = true)
                               @PathVariable("courseId") String courseId,
                               @ApiParam(name = "memberId", value = "用户id", required = true)
                               @PathVariable("memberId") String memberId);
}
